﻿var carListPanel;
var carTreePanel;
var mapPanel;
var alarmPanel;
function createMainPanel() {
    var menuString;
    if (currentService == 1) {
        menuString = '<div style="width: 100%;height: 60px;/* text-align: right; */"><img src="images/logoJISAO.jpg" height="45" width="480"><div style="width: 200px;height: 100%;float: right;"><button class="dropbtn" onClick="changPassword()">修改密码</button><button class="dropbtn" onClick="loginout()">注销</button></div>';
    }
    if (currentService == 3) {
        menuString = '<div style="width: 100%;height: 60px;/* text-align: right; */"><img src="images/logoRubbish.jpg" height="45" width="480"><div style="width: 200px;height: 100%;float: right;"><button class="dropbtn" onClick="changPassword()">修改密码</button><button class="dropbtn" onClick="loginout()">注销</button></div>'
     + '<div class="dropdown" style="width: 100px;height: 100%;float: right;"><button class="dropbtn">吨数统计</button><div class="dropdown-content"><a href="javascript:;" id="", onclick="clcWeightForDistrict()">处理厂按区统计</a><a href="javascript:;" onclick="clcWeightForFactory()">处理厂按厂统计</a><!--<a href="javascript:;" onclick="zzzWeightForDistrict()">中转站统计</a>--></div></div>';
    }
    if (currentService == 5) {
        menuString = '<div style="width: 100%;height: 60px;/* text-align: right; */"><img src="images/logoZONGHE.jpg" height="45" width="480"><div style="width: 200px;height: 100%;float: right;"><button class="dropbtn" onClick="changPassword()">修改密码</button><button class="dropbtn" onClick="loginout()">注销</button></div>';
    }
    if (currentService == 6) {
        menuString = '<div style="width: 100%;height: 60px;/* text-align: right; */"><img src="images/logoWC.jpg" height="45" width="480">'
        + '<div style="width: 200px;height: 100%;float: right;"><button class="dropbtn" onClick="changPassword()">修改密码</button><button class="dropbtn" onClick="loginout()">注销</button></div>'
        
        + '<div class="dropdown" style="width: 100px;height: 100%;float: right;"><button class="dropbtn">考勤管理</button><div class="dropdown-content"><a href="javascript:;" id="", onclick="menuToiletWorkInfo()">作业公厕查询</a><a href="javascript:;" onclick="menuAttendanceInfo()">考勤记录(日)</a></div></div>'
        + '<div class="dropdown" style="width: 100px;height: 100%;float: right;"><button class="dropbtn" onClick="menuTemporaryMission()">临时任务</button></div>'
        + '<div class="dropdown" style="width: 100px;height: 100%;float: right;"><button class="dropbtn" onClick="menuJobFeedback()">作业反馈</button></div>'
        + '<div class="dropdown" style="width: 140px;height: 100%;float: right;"><button class="dropbtn">作业公厕设定</button><div class="dropdown-content"><a href="javascript:;" id="", onclick="SettingToiletCleaner()">人员作业公厕设置</a><a href="javascript:;" onclick="SettingToiletWork()">公厕作业人员查询</a></div></div>'
        + '<div class="dropdown" style="width: 100px;height: 100%;float: right;"><button class="dropbtn" onClick="menuCleaner()">人员管理</button></div>'
        ;
    }

    var northRegion = new Ext.BoxComponent({
        region: 'north',
        height: 45, // give north and south regions a height
        autoEl: {
            tag: 'div',
            html: menuString + '</div>'
        }
    });
    //background= "images/indexzsj.gif" 上面空的background的原值
    carTreePanel = createCarTreePanel();
    carListPanel = createCarListPanel();
    alarmPanel = createAlarmPanel();



    mapPanel = new Ext.TabPanel({
        region: 'center', // a center region is ALWAYS required for border layout
        deferredRender: false,
        activeTab: 0,     // first tab initially active
        items: [{
            contentEl: 'divMainMap',
            title: '监控地图',
            closable: false,
            autoScroll: false,
            //iconCls: 'nav',
            html: "<IFRAME  border='0' id='monitor' name='monitor' src='./Services/monitor.html' frameBorder='0' width='100%' height='100%' scrolling='no'></IFRAME>"
        }


        /*, { 2018.07.16 houruixian  三维地图菜单项去掉
        contentEl: 'divMainMap',
        title: '三维地图',
        closable: false,
        autoScroll: false,
        //iconCls: 'nav',
        html: "<IFRAME  border='0' id='3dmonitor' name='3dmonitor' src='./Services/3dmonitor.html' frameBorder='0' width='100%' height='100%' scrolling='no'></IFRAME>"
        }*/],
//        listeners: {
//            //显示图形类型 2为2D图形 3为3D图形 默认为2D图形
//            tabchange: function (tp, p) {
//                if (p.title == '监控地图') {
//                    monitortype = 2;
//                    //Ext.Msg.alert('提示！', monitortype);
//                }
//                else {
//                    monitortype = 3;
//                    //Ext.Msg.alert('提示！', monitortype);
//                }
//            }
//        }
    });

    return {
        id: 'allmonitor-panel',
        layout: 'border',
        //items: [northRegion, carListPanel, carTreePanel, mapPanel]
        items: [northRegion, carListPanel, carTreePanel, alarmPanel, mapPanel]
    };
}



